typedef struct {
    void (*handle)();
} State;

void state_a() { printf("State A\n"); }
void state_b() { printf("State B\n"); }

typedef struct {
    State current_state;
} Context;

void context_change_state(Context* ctx, State new_state) {
    ctx->current_state = new_state;
}

// 使用：
Context ctx = { .current_state = { state_a } };
ctx.current_state.handle(); // 输出 "State A"